<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>

<%@ include file="/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jeDate/jedate.js'/>"></script>
</head>
<body>
<div class="njga" style="overflow: hidden;">
    <div class="bmkhcp" style="background: #fff;overflow: hidden;">
        <div class="bmkhcp_row">
            <div class="bmkhcp_lf" style="width: 100%;">
                <div class="title">我的自评</div>
                <div class="khzpzp_row khzpzp_row1">
                    <c:choose>
                        <c:when test="${type==1}">
                            <div class="p_text">季度</div>
                            <div class="zp_select">
                                <input type="text" placeholder="选择季度" class="inpt1"/>
                                <div class="arrow_down"></div>
                            </div>
                        </c:when>
                        <c:otherwise>
                            <div class="p_text">月份</div>
                            <div class="zp_select">
                                <input type="text" placeholder="选择月份" id="dateinfo" class="inpt1"/>
                                <div class="arrow_down"></div>
                            </div>
                        </c:otherwise>
                    </c:choose>
                    <button class="btn btn1">查询</button>
                   <%-- <button class="btn btn2">重置</button>--%>

                   <%-- <div class="xzzb_add" onclick="addData()"><span>+</span>
                        <c:choose>
                            <c:when test="${type==1}">
                                季度自评
                            </c:when>
                            <c:otherwise>
                                月度自评
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="xzzb_add" style="margin-right: 20px;" onclick="gotoSycj()">我的上月成绩
                    </div>--%>
                </div>
                <table id="boot_table"></table>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript">
    $(function(){
        initTable();//初始化表格
    });
</script>
<script>
    var $table = $('#boot_table'),
            $remove = $('#remove'),
            selections = [];
    function initTable() {
        $table.bootstrapTable({
            idField: "id",
            pagination: "true",
            sidePagination: 'server',
            url: "<c:url value='/evaluation/myEvaluationList.json'/>",
            height: getHeight(),
            columns: [
                /*{
                 field: 'ID',
                 checkbox: true,
                 align: 'center',
                 valign: 'middle'
                 }, */
                {

                    title: '月份',
                    field: 'month',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return value+"月";
                    }
                }, {
                    title: '德',
                    field: 'level1',
                    align: 'center',
                    valign: 'middle'
                }, {
                    field: 'level2',
                    title: '能',
                    align: 'center',
                }, {
                    field: 'level3',
                    title: '勤',
                    align: 'center',
                }, {
                    field: 'level4',
                    title: '绩',
                    align: 'center',
                }, {
                    field: 'level5',
                    title: '廉',
                    align: 'center',
                }, {
                    field: 'status',
                    title: '状态',
                    align: 'center',
                    formatter: function(value, row, index){
                        switch(value)
                        {
                            case 0:
                                return "<span style='color:red;'>未自评</span>";
                            case 1:
                                return "已自评";
                        }
                    }
                }, {
                    field: 'operate',
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index){
                        if(row.status=="0"){
                            return  '<a href="javascript:editZp('+row.dbid+')" >自评</a> ';
                        }else{
                            return  '<a href="javascript:editZp('+row.dbid+')" >查看</a> ';
                        }
                    }
                }

            ]
        });
    }
    function getHeight() {
        return $(window).height() - $('h1').outerHeight(true)-83;
    }
    //自评编辑
    function editZp(dbid) {
        var url = "<c:url value='/evaluation/findMonthZpByDbid.html?dbid='/>"+dbid;
        $('#ifrm_data', parent.document).attr("src", url);
    }
    //自评编辑结束
</script>
<script type="text/javascript">
    jeDate({
        dateCell: "#dateinfo",
        format: "YYYY-MM"
    });
    //领导评鉴-选择分数
    $(document).click(function () {
        $(".td_select_xl").slideUp(200);
    });
    $(".td_select1").click(function (e) {
        e = e || window.event;
        if (e.stopPropagation) {
            e.stopPropagation();
        } else {
            e.cancelBubble = true;
        }
        $(this).next(".td_select_xl").slideToggle(200);
        $(this).parents("tr").siblings("tr").find(".td_select_xl").hide();
        var selecttext = $(this).children("p");
        var selectmain = $(this).next(".td_select_xl");
        var lis = selectmain.find('li');
        for (var i = 0; i < lis.length; i++) {
            lis[i].onclick = function () {
                selectmain.hide();
                var textval = $(this).html();
                selecttext.text(decodeURIComponent(textval));
            }
        }
    });
    //领导评鉴-选择分数结束
    function addData() {
        var url = "<c:url value='/jump/khcp_zp.html'/>";
        $('#ifrm_data', parent.document).attr("src", url);
    }
    function gotoSycj(){
        var url = "<c:url value='/jump/khjg.html'/>";
        $('#ifrm_data', parent.document).attr("src", url);
    }
</script>
</body>

</html>